package com.keith.brainmap.collections;

import java.util.stream.Stream;

/**
 * filter() 从流中筛选出需要的元素
 *
 * @author chenli
 * @date 2021-05-21 上午 10:20
 **/
public class FilterStream {
    public static void main(String[] args) {
        String[] arr = new String[] {"你", "我", "他", "她" };
        Stream<String> stream = Stream.of(arr).filter(s -> s.contains("你"));
        stream.forEach(System.out::print);
    }
}
